<template>
  <div class="my-tag">
              <input
                class="input"
                type="text"
                placeholder="输入标签"
                v-if='isShow'

                v-select
                @blur="Modify"
                @keyup.enter='Modify'
                v-model="tag"
                
              />
              <div class="text" v-else @dblclick="Multiple">{{value}}</div>
            </div>
</template>
 
<script>
export default {
  name: "HmList",
  components: {},
  props: {
    value: {
      type:String,
      required: true
    }
  },
  data() {
    return {
      isShow: false,
      tag: ""
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    //双击(多重)
    Multiple(){
      this.isShow =true

      this.tag =this.value
    },
    //键盘弹起和失焦(修改)
    Modify() {
      this.isShow =false

      this.$emit('input',this.tag)
    }
  }
};
</script>

<style scoped lang="less">
     .my-tag {
  cursor: pointer;
  .input {
    appearance: none;
    outline: none;
    border: 1px solid #ccc;
    width: 100px;
    height: 40px;
    box-sizing: border-box;
    padding: 10px;
    color: #666;
    &::placeholder {
      color: #666;
    }
  }
}
</style>